<style>
.tab {
  width: 100%;
  height: 3rem;
  border-bottom: 1px solid #ccc;
  background: #ffff;
  display: flex;
  line-height: 3rem;
  position: sticky;
  top: 0;
  z-index: 999;
  /* z-index: 99999; */

}
.active {
  padding-bottom: 1rem;
  border-bottom: 4px solid #39d167
}
.tabboxone {
  width: 100%;
  height: 100%;
  /* background: red; */
}
.tabboxonechildren {
  width: 85%;
  height: 8rem;
  margin-right: 3.2rem;
  display: flex;
  background: #ffff;
  border: 1px solid #ffffff00;
  margin-bottom: 1rem;

}
.tabboxonechildren dl {
  width: 100%;
  height: 7rem;
  display: flex;
  margin-left: 0.2rem;
}
.tabboxonechildren dl dt {
  width: 4.75rem;
  height: 5rem;
}
.tabboxonechildren dl dd {
  margin-left: 0.8rem;
}
.tabboxonechildren dl dt img {
  width: 6rem;
  height: 9rem;
}
</style>

<template>
  <!-- 健康评测 -->
  <div>
    <van-nav-bar
      title="健康评测"
      left-arrow
      @click-left="onClickLeft"
      van-nav-bar-icon-color="black"
    />
  </div>
  <div>
    <div style="background: #ffffff">
      <van-sticky>
        <ul class="tab">
          <li
            v-for="(item, index) in list"
            :key="index"
            :class="{ active: index === currentStep }"
            @click="onChange(index)"
          >
            {{ item.title }}
          </li>
        </ul>
      </van-sticky>
    </div>
    <div v-if="currentStep === 0">
      <div class="tabboxone">
        <HotTab></HotTab>
      </div>
    </div>
    <div v-if="currentStep === 1">
      <div class="tabboxone">
        <Common_diseaseTab></Common_diseaseTab>
      </div>
    </div>
    <div v-if="currentStep === 2">
      <div class="tabboxone">
        <Mental_healthTab></Mental_healthTab>
      </div>
    </div>
    <div v-if="currentStep === 3">
      <div class="tabboxone">
        <Taste_evaluationTab></Taste_evaluationTab>
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue'

import HotTab from '@/compentents/illnessTab/HotTab/index.vue'
import Common_diseaseTab from '@/compentents/illnessTab/Common_diseaseTab/index.vue'
import Mental_healthTab from '@/compentents/illnessTab/Mental_healthTab/index.vue'
import Taste_evaluationTab from '@/compentents/illnessTab/Taste_evaluationTab/index.vue'
import axios from 'axios'
import { useRouter } from 'vue-router'
const currentStep = ref(0)
const onChange = (index) => {
  currentStep.value = index
}
const router = useRouter()
const onClickLeft = () => {
  router.go(-1)
}
const list = ref([
  { title: '热门' },
  { title: '常见疾病' },
  { title: '心理健康' },
  { title: '趣味评估' },
])

//热门数据

//常见疾病数据
const Common_disease = ref([])
// 心理健康数据
const Mental_health = ref([])
// 趣味评估数据
const Taste_evaluation = ref([])
//获取数据
</script>
